﻿/* 1. Define abstract class Shape with only one abstract
 * method CalculateSurface() and fields width and height.
 * Define two new classes Triangle and Rectangle that 
 * implement the virtual method and return the surface of
 * the figure (height*width for rectangle and 
 * height*width/2 for triangle). Define class Circle and suitable
 * constructor so that at initialization height must be kept equal 
 * to width and implement the CalculateSurface() method. Write a
 * program that tests the behavior of  the CalculateSurface() method
 * for different shapes (Circle, Rectangle, Triangle) stored in an array.
*/

using System;
using System.Globalization;
using System.Linq;
using System.Threading;

namespace _1.AbstractShapeClass
{
    class Program
    {
        static void Main()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

            Shape[] shapes = 
            {
                new Triangle(3d,4d),
                new Rectangle(5d,7d),
                new Circle(7d)
            };

            foreach (var shape in shapes)
            {
                Console.WriteLine(shape.CalculateSurface());
                Console.WriteLine();
            }
            
            
        }
    }
}
